package com.xiaojie.ext;


import com.xiaojie.parse.model.DataModel;
import com.xiaojie.progress.ExportStage;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
 * 使用{@link com.xiaojie.ext.cust.CustExportExecute}替代*
 * @author liaoke
 * @date 2021/11/17
 * 导出数据前操作
 **/
@Deprecated
public interface AfterExportData {

    /**
     * 导出数据后扩展点
     *
     * @param dataModel
     * @param dataMap
     * @param exportWorkDir
     */
    default void process(DataModel dataModel, Map<String, List<Map>> dataMap, File exportWorkDir) {
        doBefore();
        doProcess(dataModel, dataMap, exportWorkDir);
        doAfter();
    }

    default void doBefore() {
        ExportStage.EXT_AFTER_EXPORT.progress(0);
    }

    default void doAfter() {
        ExportStage.EXT_AFTER_EXPORT.progress(100);
    }

    void doProcess(DataModel dataModel, Map<String, List<Map>> dataMap, File exportWorkDir);
}
